
<div class="tipbox tipbox-warning mb5">
    <span class="fn-fb">功能提示</span> : 支付有礼是在合作好店中买单付款,达到指定额度或次数后,可以在某个好店领取特定礼品。<br />
    <span class="gray">
        1、礼品包含不限于新的优惠券、虚拟产品(手机话费)、现金红包。<br />
        2、小程序广告链接地址：/pages/helper/webview?src=入口网址
    </span>
</div>  
<div id="actionbar">
    <a href="{:url('manage.gift/add')}" class="button button-blue"> <i class="iconfont icon-add_icon"></i>创建活动</a>
</div>
<table class="table">
    <thead>
        <tr>
            <th class="w170">操作</th>
            <th>活动标题</th>          
            <th class="w80">状态</th>
            <th class="w140">开始时间</th>
            <th class="w140">结束时间</th>
            <th class="w400">入口网址</th>
            <th class="w50 fn-tac">删除</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="button-group">
                <a class="button" href="{:url('manage.gift/edit',['id'=>$vo.id])}" title="修改"><i class="iconfont icon-edit"></i>编辑</a>
                <a class="button" href="{:url('manage.gift/store',['id'=>$vo.id])}" title="好店"><i class="iconfont icon-store_icon"></i>好店</a>
            </td>
            <td><a class="review" href="javascript:;" url="{:url('manage.gift/review',['id'=>$vo.id])}"  title="预览">{$vo.title}</a></td><td>
                <a class="isAction" url="{:url('manage.gift/isLock',['id'=>$vo.id])}" href="javascript:;" title="置顶/取消">
                    {if $vo.is_lock}<span class="badge bg-green">解锁</span>{else}<span class="badge">正常</span>{/if}
                </a>
            </td>
            <td>{$vo.start_time|date='Y-m-d H:i'}</td>
            <td>{$vo.end_time|date='Y-m-d H:i'}</td>
            <td>
                <a class="trigger" href="javascript:;" rel="{:action("common/library/qrcode/create",['url'=>urls('allwin/gift/index',$member_miniapp_id,['id' => $vo.id]),'qrname'=>md5('allwin_gift_'.$member_miniapp_id.'_'.$vo.id)],'facade')}"><i class="iconfont icon-erweima1"></i>
                {:urls('allwin/gift/index',$member_miniapp_id,['id' => $vo.id])}
                </a>
            </td>
            <td class="fn-tac">
                <a class="isDel" url="{:url('manage.gift/delete',['id'=>$vo.id])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i></a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base', 'layer','tip',function () {
    $('.isDel').isDel();
    $(".trigger").powerFloat({targetMode:"ajax"});
    $('.review').click(function () {
        openwin($(this).attr('url'));
    })
    $('.isAction').click(function () {
        var url = $(this).attr("url");
        parent.layer.confirm('确认要设置当前用户?',{ icon: 3,title: '友情提示' }, function (index) {
            $.getJSON(url, function (rel) {
                if(rel.code == 0){
                    parent.layer.alert(rel.msg)
                }else{
                    window.location.reload();
                }
            });
            parent.layer.close(index);
        });
    })
})
</script>